#!/bin/bash
if [ $# -lt 1 ]
then
  echo "start or stop???"
  exit
fi

case $1 in
start)
	for i in hadoop202 hadoop203 hadoop204
	do
		echo "========== $i ==========" 
		ssh $i '/opt/module/kafka/bin/kafka-server-start.sh -daemon /opt/module/kafka/config/server.properties'
		echo $?
	done
;;
stop)
	for i in hadoop202 hadoop203 hadoop204
	do
		echo "========== $i ==========" 
		ssh $i '/opt/module/kafka/bin/kafka-server-stop.sh'
		echo $?
	done
;;
*)
  echo "args is error"
;;
esac